home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip Mayıs 2001.iso / prog / share / 07 / ASPFusion / data1.cab / Admin_Pages / Admin / act_build_automate.asp < prev    next >
Encoding:
Text File  |  2001-03-25  |  3.1 KB  |  69 lines

  1. <%
  2. on error resume next
  3. dim SecurityBox
  4. if (Session("Index") <> "Index") then 'add your session management code here
  5.     Response.Redirect "index.asp"
  6. elseif ((Request.QueryString("FileName") <> "") and (Request.QueryString("Return") <> "")) then
  7.         set File = Server.CreateObject("Scripting.FileSystemObject")
  8.         File.DeleteFile(Request.QueryString("FileName"))
  9.         set File = nothing
  10.         Response.Redirect(Request.QueryString("Return"))
  11.     else
  12.         if ((Request.QueryString("WebSiteName") = "") or (Request.QueryString("Path") = "") or (Request.QueryString("Return") = "")) then
  13.             Session("Index") = ""
  14.             Session("Error") = ""
  15.             Response.Redirect("index.asp") 'default redirection
  16.         else
  17.             set File = Server.CreateObject("Scripting.FileSystemObject")
  18.             if (not File.FolderExists(Request.QueryString("Path"))) then
  19.                 Session("Error") = "Path " & Request.QueryString("Path") & " does not exist, please supply valid path for ASPFusion Security Box " & Request.QueryString("WebSiteName")
  20.                 set File = nothing
  21.                 Response.Redirect(Request.QueryString("Return"))
  22.             end if
  23.             set File = nothing
  24.             set SecurityBox = Server.CreateObject("AdvFusionBox.FusionBox")
  25.             set Result = SecurityBox.ReturnValues("Admin.ini", "Settings", "Applied")
  26.             if (SecurityBox.IsError = 1) then
  27.                 Session("Error") = SecurityBox.ErrorReason
  28.                 set SecurityBox = nothing
  29.                 Response.Redirect(Request.QueryString("Return"))
  30.             end if
  31.             set Rst = SecurityBox.GetRegVal("", "InstallationPath", "String")
  32.             if (SecurityBox.IsError = 1) then
  33.                 Session("Error") = SecurityBox.ErrorReason
  34.                 set Result = nothing
  35.                 set SecurityBox = nothing
  36.                 Response.Redirect(Request.QueryString("Return"))
  37.             end if
  38.             set File = Server.CreateObject("Scripting.FileSystemObject")
  39.             ActText = vbCrLf & "%" & ">"
  40.             for each Member in Result
  41.                 ActFileName = Rst.Value & "\Admin\act_automate_" & Member.Value & ".asp"
  42.                 if (File.FileExists(ActFileName)) then
  43.                     ActText = ActText & vbCrLf & "<!--- #include file = 'act_automate_" & Member.Value & ".asp' --->"
  44.                 end if
  45.             next
  46.             set File = nothing
  47.             set Result = nothing
  48.             ActText = ActText & vbCrLf & "<" & "%"
  49.             TargetPath = SecurityBox.UniqueFileName(Rst.Value & "\Admin\act_automate.asp", 1)
  50.             if (SecurityBox.IsError = 1) then
  51.                 Session("Error") = SecurityBox.ErrorReason
  52.                 set Rst = nothing
  53.                 set SecurityBox = nothing
  54.                 Response.Redirect(Request.QueryString("Return"))
  55.             end if
  56.             SecurityBox.Insert TargetPath, ActText, "'ASP Include Start Mark", "'ASP Include End Mark"
  57.             if (SecurityBox.IsError = 1) then
  58.                 Session("Error") = SecurityBox.ErrorReason
  59.                 set Rst = nothing
  60.                 set SecurityBox = nothing
  61.                 Response.Redirect(Request.QueryString("Return"))
  62.             end if
  63.             TargetFile = mid(TargetPath,len(Rst.Value)+8,len(TargetPath))
  64.             set Rst = nothing
  65.             set SecurityBox = nothing
  66.             Response.Redirect(TargetFile&"?WebSiteName="&Replace(Request.QueryString("WebSiteName"), " ", "%20")&"&Path="&Replace(Request.QueryString("Path"), " ", "%20")&"&Return="&Replace(Request.QueryString("Return"), " ", "%20")&"&FileName="&Replace(TargetPath, " ", "%20"))
  67.         end if
  68.     end if
  69. %>